#!/usr/bin/env python

import time
import random
import os

LFSFS = '/home/usmanm/fuse'
FUSEFS = '/home/usmanm/xmp/home/usmanm'
EXT3FS = '/home/usmanm/local'

NOOFDIRS = 1000

def main():
    start = time.time()
    for j in range(NOOFDIRS):
        os.mkdir(LFSFS + '/dir' + str(j))
    print 'LFS mkdir: ' + str(time.time() - start)

    start = time.time()
    for j in range(NOOFDIRS):
        os.mkdir(FUSEFS + '/dir' + str(j))
    print 'FUSE mkdir: ' + str(time.time() - start)

    start = time.time()
    for j in range(NOOFDIRS):
        os.mkdir(EXT3FS + '/dir' + str(j))
    print 'EXT3 mkdir: ' + str(time.time() - start)

    print

    start = time.time()
    for j in range(NOOFDIRS):
        os.rmdir(LFSFS + '/dir' + str(j))
    print 'FUSE rmdir: ' + str(time.time() - start)

    start = time.time()
    for j in range(NOOFDIRS):
        os.rmdir(FUSEFS + '/dir' + str(j))
    print 'FUSE rmdir: ' + str(time.time() - start)

    start = time.time()
    for j in range(NOOFDIRS):
        os.rmdir(EXT3FS + '/dir' + str(j))
    print 'EXT3 rmdir: ' + str(time.time() - start)


if __name__ == '__main__':
    main()
